package basic;

import java.io.File;
import java.io.FileInputStream;

public class ReadFile {

    public static void main(String[] args) throws Exception{
        
        File file = new File("basic","lines.txt");
        System.out.println(file.getAbsolutePath());
      FileInputStream fis = new FileInputStream(file);
      byte[] byteArray = new byte[(int)file.length()];
      fis.read(byteArray);
      String data = new String(byteArray);
      String[] stringArray = data.split("\r\n");
      System.out.println("文件中的行数是 ::"+stringArray.length);
      System.out.println(stringArray.length);
    }
    
}
